import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        gnum: sessionStorage.getItem('gnum'),
        gm: sessionStorage.getItem('gm'),

        islogin: sessionStorage.getItem('islogin'),
        account: sessionStorage.getItem('account'),
    },
    mutations: {
        spnum(state, num) {
            state.gnum = num
        },
        loginok(state, name) {
            state.islogin = true;
            state.account = name;
        },
        buy(state, price) {
            state.gm = price;
        }
    },
    actions: {

    }
})